<?php

require_once(sfConfig::get('sf_lib_dir').'/filter/base/BaseFormFilterPropel.class.php');

/**
 * Recurso filter form base class.
 *
 * @package    proyectoMOD2
 * @subpackage filter
 * @author     Your name here
 * @version    SVN: $Id: sfPropelFormFilterGeneratedTemplate.php 13459 2008-11-28 14:48:12Z fabien $
 */
class BaseRecursoFormFilter extends BaseFormFilterPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'cedula'           => new sfWidgetFormFilterInput(array('with_empty'=>false)),
      'login'            => new sfWidgetFormFilterInput(array('with_empty'=>false)),
      'password'         => new sfWidgetFormFilterInput(),
      'primer_nombre'    => new sfWidgetFormFilterInput(array('with_empty'=>false)),
      'segundo_nombre'   => new sfWidgetFormFilterInput(),
      'primer_apellido'  => new sfWidgetFormFilterInput(array('with_empty'=>false)),
      'segundo_apellido' => new sfWidgetFormFilterInput(),
      'fecha_nac'        => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate(), 'with_empty' => false)),
      'edo_civil'        => new sfWidgetFormFilterInput(array('with_empty'=>false)),
      'sexo'             => new sfWidgetFormFilterInput(array('with_empty'=>false)),
      'telf_domicilio'   => new sfWidgetFormFilterInput(),
      'telf_celular'     => new sfWidgetFormFilterInput(),
      'direccion'        => new sfWidgetFormFilterInput(),
    ));

    $this->setValidators(array(
      'cedula'           => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'login'            => new sfValidatorPass(array('required' => false)),
      'password'         => new sfValidatorPass(array('required' => false)),
      'primer_nombre'    => new sfValidatorPass(array('required' => false)),
      'segundo_nombre'   => new sfValidatorPass(array('required' => false)),
      'primer_apellido'  => new sfValidatorPass(array('required' => false)),
      'segundo_apellido' => new sfValidatorPass(array('required' => false)),
      'fecha_nac'        => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDate(array('required' => false)), 'to_date' => new sfValidatorDate(array('required' => false)))),
      'edo_civil'        => new sfValidatorPass(array('required' => false)),
      'sexo'             => new sfValidatorPass(array('required' => false)),
      'telf_domicilio'   => new sfValidatorPass(array('required' => false)),
      'telf_celular'     => new sfValidatorPass(array('required' => false)),
      'direccion'        => new sfValidatorPass(array('required' => false)),
    ));

    $this->widgetSchema->setNameFormat('recurso_filters[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'Recurso';
  }

  public function getFields()
  {
    return array(
      'id'               => 'Number',
      'cedula'           => 'Number',
      'login'            => 'Text',
      'password'         => 'Text',
      'primer_nombre'    => 'Text',
      'segundo_nombre'   => 'Text',
      'primer_apellido'  => 'Text',
      'segundo_apellido' => 'Text',
      'fecha_nac'        => 'Date',
      'edo_civil'        => 'Text',
      'sexo'             => 'Text',
      'telf_domicilio'   => 'Text',
      'telf_celular'     => 'Text',
      'direccion'        => 'Text',
    );
  }
}
